<?

$string = "var tinyMCEImageList = new Array( "; 

foreach ($images as $image){
	$type = substr($image['Asset']['url'], -3);
	if ($type == "gif" || $type == "jpg" || $type == "png")
		$string .= '["'.$image['Asset']['name'].'", "' . TINY_IMG_PATH . $image['Asset']['url'].'"] , ';
}

if(substr($string, -2, 1) == ",") $string = substr($string, 0, -2);
$string .= ");";
echo $string;

?>